<template>
  <el-space wrap :size="props.params.eltagSize">
    <div>
      <!-- <el-tag :type="props.params.styleClass(props.params.data)">{{
            props.params.text(props.params.data)
          }}</el-tag> -->
      <!-- {{props.params.styleClass}} -->
      <!-- <el-select v-model="props.params.data.greyCode"  @change="selectChange" @click="clickList">
            <el-option v-for="item in options" :key="item.id" :label="item.greyCode" :value="item.greyCode" />
          </el-select> -->
      <a-select popup-container="html"  class="bacClass" v-model="props.params.data.colorDepth" style="width:170px;" @focus="focusSel"
        :disabled="props.params.data.letBoolNum == 2">
        <a-option v-for="item in pageData" :label="item.colorDepth"
          :value="item.colorDepth">{{ item.colorDepth }}</a-option>
      </a-select>

    </div>
  </el-space>
</template>
      
<script setup lang="ts">
import { post } from "@/api/http";
import { Form, Message, Modal, Pagination } from "@arco-design/web-vue";
import { ref, onMounted } from "vue";
const props = withDefaults(
  defineProps<{
    params: any,
  }>(),
  {
    params: {},
  }
)



//下拉框得到焦点
const focusSel = () => {
  selCxAll({ colorDepth: "" })
}
//下拉数据  
let pageData = ref([])
//   let options = ref<any>(pageData.value);
//   let loading = ref(false);
//   const handleSearch = (value: any) => {
//       const ob = { colourNumber: value,}
//       loading.value = true;
//       selCxAll(ob);
//       options.value = pageData.value;
//       loading.value = false;
//   };

//下拉框查询
function selCxAll(val: any) {
  post({
    url: "/pdm/colorDepth/getFieldValue",
    data: val
  }).then(({ data, code, message }: any) => {
    if (code === 200) {
      pageData.value = data;
    } else {
      Message.error({
        content: message,
        duration: 5000,
      });
    }
  });
}

// let selectChange = () => {
//   options.value.map((o) => {
//     if (props.params.data.greyCode == o.greyCode) {
//       props.params.color(props.params, o.greyName)
//     }

//   })

// }
// let clickList = () => {
//   post({
//     url: "/wms/BlankStock/getList",
//     data: {
//       greyCode: ''
//     }
//   }).then(({ data, code }: any) => {
//     console.log(data, "下拉返回");
//     console.log(data)
//     if (code === 200) {
//       options.value = data;

//     }
//   });
// }
onMounted(() => {

})


</script>
      
<style scoped>
.currency {
  color: blue;
}
</style>